package com.yidu.verycd_reception.service.impl;

import com.yidu.verycd_reception.diaoyong.BackgroundClient;
import com.yidu.verycd_reception.entity.VerycdComment;
import com.yidu.verycd_reception.service.VerycdCommentService;
import com.yidu.verycd_reception.util.BaseMessage;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * (VerycdComment)表服务实现类
 *
 * @author makejava
 * @since 2020-07-27 09:57:00
 */
@Service("verycdCommentService")
public class VerycdCommentServiceImpl implements VerycdCommentService {

    @Resource
    BackgroundClient backgroundClient;
    /**
     * 通过ID查询单条数据
     *
     * @param comId 主键
     * @return 实例对象
     */
    @Override
    public VerycdComment queryById(Integer comId) {

        return null;
    }

    /**
     * 查询多条数据
     *
     * @param verycdComment 查询起始位置
     * @return 对象列表
     */
    @Override
    public Map<String,Object> queryAllByLimit(VerycdComment verycdComment) {

        return backgroundClient.queryAllByLimit(verycdComment.getPage(),verycdComment.getLimit());
    }

    /**
     * 新增数据
     *
     * @param verycdComment 实例对象
     * @return 实例对象
     */
    @Override
    public BaseMessage insert(VerycdComment verycdComment) {
        return backgroundClient.insert(verycdComment.getComContent(),verycdComment.getComTime(),verycdComment.getUserId(),verycdComment.getMovieId());

    }

    /**
     * 修改数据
     *
     * @param verycdComment 实例对象
     * @return 实例对象
     */
    @Override
    public VerycdComment update(VerycdComment verycdComment) {
        return null;
    }

    /**
     * 通过主键删除数据
     *
     * @param comId 主键
     * @return 是否成功
     */
    @Override
    public BaseMessage delete(Integer comId) {
        return backgroundClient.delete(comId);
    }
}